package com.blog.blogservice.app.service;

import com.blog.blogservice.domain.entity.Article;
import com.blog.blogservice.domain.entity.ArticleSummary;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.concurrent.ExecutionException;

/**
 * 文章表(Article)应用服务
 *
 * @author guanglin.ma
 * @since 2024-03-02 23:24:54
 */
public interface ArticleService {

    /**
     * 添加文章
     *
     * @param file
     * @param article
     * @return
     */
    Boolean addArticle(MultipartFile file, Article article) throws Exception;

    /**
     * 删除文章
     *
     * @param articleId
     */
    void deleteArticle(Integer articleId) throws ExecutionException, InterruptedException;

    /**
     * 文章列表
     *
     * @param article
     * @return
     */
    List<Article> listArticle(Article article);

    List<Article> articleApiList(Article article);

    /**
     * 文章 标签 分类 汇总
     * @return
     */
    ArticleSummary articleSummary();

    /**
     * 根据编码查询标签分类文章
     * @param type
     * @param code
     * @return
     */
    List<Article> articleByTypeCode(String type, String code);
}

